<script>
    function editSrnKrjSikBawahSave() { 
        //arrId=document.getElementById("pSikjId").val();
        var arrNama=$('#pSikjName').val();
        var arrPekerjaan=$('#pSikjDesc').val();
        var arrLantai=$('#pSikjFloor').val();
        var arrLocation=$('#pSikjLocation').val();
        var arrAccess=$('#pSikjAccess').val();
        var arrNamaBarang=$('#pSikjBarang').val(); 
        var arrSerial=$('#pSikjSn').val();
        
        
        $.post("<?= site_url() ?>search_globalA/edit_sikBawahSave", {
            pCType          : $('#pCType').val(),
            pSikId          : $('#pCtrlID').val(),
            //UNTUK PILIHAN TABEL BAWAH
            //pSikIdBawah     : arrId,
            pSikName        : arrNama,
            pSikPekerjaan   : arrPekerjaan,
            pSikLantai      : arrLantai,
            pSikLocation    : arrLocation,
            pSikAccess      : arrAccess,
            pSikNamaBarang  : arrNamaBarang,
            pSikSerial      : arrSerial,
            
            
        },
            function(data) {
                $.post("<?= site_url() ?>search_global/edit_req", {
                    cRequestNo : $('#pCtrlID').val(),
                    cType : $('#pCType').val(),
                    cTab : "saranaKerja"
                },
                function(data) {
                    $('#top').html(data); //Tampilkan di id TOP yang ada di Induk Search Global, redirect ke id top di halaman ke-2
                });
            }
        
        );
    }
    function back() { 
        $.post("<?= site_url() ?>search_global/edit_req", {
            cRequestNo : $('#pCtrlID').val(),
            cType : $('#pCType').val(),
            cTab : "saranaKerja"
        },
        function(data) {
            $('#top').html(data); //Tampilkan di id TOP yang ada di Induk Search Global, redirect ke id top di halaman ke-2
        });
    }
</script>


<form id="formarea" role="form" method="post" action="#">
<input type="hidden" value="<?php echo $cRequestNo; ?>" id="pCtrlID" />
<input type="hidden" value="<?php echo $cType; ?>" id="pCType" />
<div class="panel panel-success">
    <div class="panel-heading">
    <h4 class="panel-title"><b class="caret"></b><b> Request</b></h4>
    </div>
    <div class="panel-body">

        <div class="row"> 
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="control-label col-md-3">Nama</label>
                    <div class="col-md-3">                
                        <input type="text" id="pSikjName" class="form-control input-sm" value=""/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row"> 
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="control-label col-md-3">Pekerjaan</label>
                    <div class="col-md-3">  
                        <input type="text" id="pSikjDesc" class="form-control input-sm" value=""/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row"> 
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="control-label col-md-3">Lantai</label>
                    <div class="col-md-3">
                        <select id="pSikjFloor" class="form-control input-sm">
                            <?php 
                            foreach ($getFloor as $v){ 
                                $lt=$v['MST_FLOOR_DESC'];?>
                                    <option value="<?php echo $lt; ?>" > <?php echo $lt;?></option>
                             <?php
                             }?>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row"> 
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="control-label col-md-3">Location</label>
                    <div class="col-md-3">  
                        <input type="text" id="pSikjLocation" class="form-control input-sm" value=""/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row"> 
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="control-label col-md-3">Access</label>
                    <div class="col-md-3">  
                        <select id="pSikjAccess" class="form-control input-sm">
                            <option value="N" >No</option>
                            <option value="Y" >Yes</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="row"> 
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="control-label col-md-3">Nama Barang</label>
                    <div class="col-md-3">  
                        <input type="text" id="pSikjBarang" class="form-control input-sm" value=""/>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="row"> 
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="control-label col-md-3">Serial Number</label>
                    <div class="col-md-3">  
                        <input type="text" id="pSikjSn" class="form-control input-sm" value=""/>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="row"> 
            <div class="col-sm-12">
                <div class="form-group">
                    <div class="col-md-3">  
                        <button type="button" class="btn btn-success btn-block" onclick="editSrnKrjSikBawahSave();" >Add Now</button>
                    </div>
                    <div class="col-md-3">  
                        <button type="button" class="btn btn-default btn-block" onclick="back();" >Cancel</button>
                    </div>
                </div>
            </div>
        </div>


    </div>
</div>

</form>